#include<bits/stdc++.h>
using namespace std;
int n,a[100010],bo[100010];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    int maxn=INT_MIN;
    for(int i=0;i<n;i++){
        cin>>a[i];
        maxn=max(maxn,a[i]);
        bo[a[i]]++;
    }
    int lp=0,f=0;
    for(int i=1;i<=maxn;i++){
        if(f==0&&bo[i]){
            f=1;
            lp=i;
        }else if(bo[i]){
            if(bo[i]>=bo[lp]){
                n-=bo[lp];
                bo[lp]=0;
            }else{
                n-=bo[i];
                bo[i]=bo[lp];
                bo[lp]=0;
            }
            lp=i;
        }
    }
    cout<<n<<endl;
}